From: Dan Winship Date: Fri, 25 Mar 2011 14:14:55 +0000 (-0400) Subject: popupMenu: fix relayout after submenu open/close X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~8470 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=924b31233bbcea2980febb776b947142a6559d8d;p=gnome-shell.git popupMenu: fix relayout after submenu open/close Because of the GtkSizeGroup-like trickiness we're doing with PopupMenuItems, we need to force Clutter to discard its cached size requests for them any time the menu itself changes size. https://bugzilla.gnome.org/show_bug.cgi?id=645647 --- diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index 97a9c4d7f..fc6140569 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -765,6 +765,7 @@ PopupMenuBase.prototype = { } else { this.box = new St.BoxLayout({ vertical: true }); } + this.box.connect_after('queue-relayout', Lang.bind(this, this._menuQueueRelayout)); this.isOpen = false; @@ -893,6 +894,16 @@ PopupMenuBase.prototype = { } }, + // Because of the above column-width funniness, we need to do a + // queue-relayout on every item whenever the menu itself changes + // size, to force clutter to drop its cached size requests. (The + // menuitems will in turn call queue_relayout on their parent, the + // menu, but that call will be a no-op since the menu already + // has a relayout queued, so we won't get stuck in a loop. + _menuQueueRelayout: function() { + this.box.get_children().map(function (actor) { actor.queue_relayout(); }); + }, + addActor: function(actor) { this.box.add(actor); },